package com.dooioo.pns.api.leancloud;

import com.dooioo.pns.entity.enums.Platform;

import java.io.Serializable;

/**
 * Created with IntelliJ IDEA.
 * PackageName:com.dooioo.pns.entity.model
 * Author: Jerry.hu
 * Create: Jerry.hu (2015-07-27 下午7:39)
 * Description:
 * To change this template use File | Settings | File Templates.
 */
public class Where implements Serializable{
	private static final long serialVersionUID = -8469620042444368890L;
	private String installationId;
	private String deviceToken;

	public String getInstallationId() {
		return installationId;
	}

	public void setInstallationId(String installationId) {
		this.installationId = installationId;
	}

	public String getDeviceToken() {
		return deviceToken;
	}

	public void setDeviceToken(String deviceToken) {
		this.deviceToken = deviceToken;
	}

	public void setUuid(Platform platform,String uuid){
		switch (platform){
			case ANDROID:
				this.setInstallationId(uuid);
				break;
			case IOS:
				this.setDeviceToken(uuid);
				break;
		}
	}

	@Override
	public String toString() {
		final StringBuffer sb = new StringBuffer("Where{");
		sb.append("installationId='").append(installationId).append('\'');
		sb.append(", deviceToken='").append(deviceToken).append('\'');
		sb.append('}');
		return sb.toString();
	}
}
